﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract SklDZahtijevStavke typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class SklDZahtijevStavkeDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<SklDZahtijevStavkeDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.SklDZahtijevStavke _currentSklDZahtijevStavke = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxSklDZahtijevStavkeDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxSklDZahtijevStavkeErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxSklDZahtijevStavkeBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDSklDZahtjevGlava property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDSklDZahtjevGlavaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the SifraArtikla property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxSifraArtiklaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the NazivArtikla property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxNazivArtiklaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Batch property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxBatchDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the NettoMasa property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxNettoMasaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Kolicina property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxKolicinaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Cijena property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxCijenaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Valuta property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxValutaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Porijeklo property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPorijekloDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DateUIModified property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDateUIModifiedDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.SklDZahtjevGlava> _IDSklDZahtjevGlavaList;
		
		/// <summary> 
		/// The list of selectable SklDZahtjevGlava
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.SklDZahtjevGlava> IDSklDZahtjevGlavaList
		{
			get {return this._IDSklDZahtjevGlavaList;}
			set 
			{
				this._IDSklDZahtjevGlavaList = value;
				this.uxIDSklDZahtjevGlavaDataGridViewColumn.DataSource = null;
				this.uxIDSklDZahtjevGlavaDataGridViewColumn.DataSource = this._IDSklDZahtjevGlavaList;
			}
		}
		
		private bool _allowNewItemInIDSklDZahtjevGlavaList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of SklDZahtjevGlava
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDSklDZahtjevGlavaList
		{
			get { return _allowNewItemInIDSklDZahtjevGlavaList;}
			set
			{
				this._allowNewItemInIDSklDZahtjevGlavaList = value;
				this.uxIDSklDZahtjevGlavaDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.SklDZahtijevStavke> _SklDZahtijevStavkeList;
				
		/// <summary> 
		/// The list of SklDZahtijevStavke to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.SklDZahtijevStavke> SklDZahtijevStavkeList
		{
			get {return this._SklDZahtijevStavkeList;}
			set
			{
				this._SklDZahtijevStavkeList = value;
				this.uxSklDZahtijevStavkeBindingSource.DataSource = null;
				this.uxSklDZahtijevStavkeBindingSource.DataSource = value;
				this.uxSklDZahtijevStavkeDataGridView.DataSource = null;
				this.uxSklDZahtijevStavkeDataGridView.DataSource = this.uxSklDZahtijevStavkeBindingSource;				
				//this.uxSklDZahtijevStavkeBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxSklDZahtijevStavkeBindingSource_ListChanged);
				this.uxSklDZahtijevStavkeBindingSource.CurrentItemChanged += new System.EventHandler(OnSklDZahtijevStavkeBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnSklDZahtijevStavkeBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentSklDZahtijevStavke = uxSklDZahtijevStavkeBindingSource.Current as Entities.SklDZahtijevStavke;
			
			if (_currentSklDZahtijevStavke != null)
			{
				_currentSklDZahtijevStavke.Validate();
			}
			//_SklDZahtijevStavke.Validate();
			OnCurrentEntityChanged();
		}

		//void uxSklDZahtijevStavkeBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.SklDZahtijevStavke"/> instance.
		/// </summary>
		public Entities.SklDZahtijevStavke SelectedSklDZahtijevStavke
		{
			get {return this._currentSklDZahtijevStavke;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxSklDZahtijevStavkeDataGridView.VirtualMode;}
			set
			{
				this.uxSklDZahtijevStavkeDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxSklDZahtijevStavkeDataGridView.AllowUserToAddRows;}
			set {this.uxSklDZahtijevStavkeDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxSklDZahtijevStavkeDataGridView.AllowUserToDeleteRows;}
			set {this.uxSklDZahtijevStavkeDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxSklDZahtijevStavkeDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxSklDZahtijevStavkeDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="SklDZahtijevStavkeDataGridViewBase"/> class.
		/// </summary>
		public SklDZahtijevStavkeDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxSklDZahtijevStavkeDataGridView = new System.Windows.Forms.DataGridView();
			this.uxSklDZahtijevStavkeBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxSklDZahtijevStavkeErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDSklDZahtjevGlavaDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxSifraArtiklaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNazivArtiklaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxBatchDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNettoMasaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxKolicinaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxCijenaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxValutaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPorijekloDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDateUIModifiedDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxIDSklDZahtjevGlavaBindingSource = new SklDZahtjevGlavaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDSklDZahtjevGlavaBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxSklDZahtijevStavkeDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxSklDZahtijevStavkeBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxSklDZahtijevStavkeErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxSklDZahtijevStavkeErrorProvider
			// 
			this.uxSklDZahtijevStavkeErrorProvider.ContainerControl = this;
			this.uxSklDZahtijevStavkeErrorProvider.DataSource = this.uxSklDZahtijevStavkeBindingSource;						
			// 
			// uxSklDZahtijevStavkeDataGridView
			// 
			this.uxSklDZahtijevStavkeDataGridView.AutoGenerateColumns = false;
			this.uxSklDZahtijevStavkeDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxSklDZahtijevStavkeDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxIDSklDZahtjevGlavaDataGridViewColumn,
		this.uxSifraArtiklaDataGridViewColumn,
		this.uxNazivArtiklaDataGridViewColumn,
		this.uxBatchDataGridViewColumn,
		this.uxNettoMasaDataGridViewColumn,
		this.uxKolicinaDataGridViewColumn,
		this.uxCijenaDataGridViewColumn,
		this.uxValutaDataGridViewColumn,
		this.uxPorijekloDataGridViewColumn,
		this.uxDateUIModifiedDataGridViewColumn			});
			this.uxSklDZahtijevStavkeDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxSklDZahtijevStavkeDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxSklDZahtijevStavkeDataGridView.Name = "uxSklDZahtijevStavkeDataGridView";
			this.uxSklDZahtijevStavkeDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxSklDZahtijevStavkeDataGridView.TabIndex = 0;	
			this.uxSklDZahtijevStavkeDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxSklDZahtijevStavkeDataGridView.EnableHeadersVisualStyles = false;
			this.uxSklDZahtijevStavkeDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnSklDZahtijevStavkeDataGridViewDataError);
			this.uxSklDZahtijevStavkeDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnSklDZahtijevStavkeDataGridViewCellValueNeeded);
			this.uxSklDZahtijevStavkeDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnSklDZahtijevStavkeDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxIDSklDZahtjevGlavaDataGridViewColumn
			//
			this.uxIDSklDZahtjevGlavaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDSklDZahtjevGlavaDataGridViewColumn.DataPropertyName = "IDSklDZahtjevGlava";
			this.uxIDSklDZahtjevGlavaDataGridViewColumn.HeaderText = "IDSklDZahtjevGlava";
			this.uxIDSklDZahtjevGlavaDataGridViewColumn.Name = "uxIDSklDZahtjevGlavaDataGridViewColumn";
			this.uxIDSklDZahtjevGlavaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDSklDZahtjevGlavaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDSklDZahtjevGlavaDataGridViewColumn.ReadOnly = false;		
			//
			// uxSifraArtiklaDataGridViewColumn
			//
			this.uxSifraArtiklaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxSifraArtiklaDataGridViewColumn.DataPropertyName = "SifraArtikla";
			this.uxSifraArtiklaDataGridViewColumn.HeaderText = "SifraArtikla";
			this.uxSifraArtiklaDataGridViewColumn.Name = "uxSifraArtiklaDataGridViewColumn";
			this.uxSifraArtiklaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxSifraArtiklaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxSifraArtiklaDataGridViewColumn.ReadOnly = false;		
			//
			// uxNazivArtiklaDataGridViewColumn
			//
			this.uxNazivArtiklaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNazivArtiklaDataGridViewColumn.DataPropertyName = "NazivArtikla";
			this.uxNazivArtiklaDataGridViewColumn.HeaderText = "NazivArtikla";
			this.uxNazivArtiklaDataGridViewColumn.Name = "uxNazivArtiklaDataGridViewColumn";
			this.uxNazivArtiklaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNazivArtiklaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNazivArtiklaDataGridViewColumn.ReadOnly = false;		
			//
			// uxBatchDataGridViewColumn
			//
			this.uxBatchDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxBatchDataGridViewColumn.DataPropertyName = "Batch";
			this.uxBatchDataGridViewColumn.HeaderText = "Batch";
			this.uxBatchDataGridViewColumn.Name = "uxBatchDataGridViewColumn";
			this.uxBatchDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxBatchDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxBatchDataGridViewColumn.ReadOnly = false;		
			//
			// uxNettoMasaDataGridViewColumn
			//
			this.uxNettoMasaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNettoMasaDataGridViewColumn.DataPropertyName = "NettoMasa";
			this.uxNettoMasaDataGridViewColumn.HeaderText = "NettoMasa";
			this.uxNettoMasaDataGridViewColumn.Name = "uxNettoMasaDataGridViewColumn";
			this.uxNettoMasaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNettoMasaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNettoMasaDataGridViewColumn.ReadOnly = false;		
			//
			// uxKolicinaDataGridViewColumn
			//
			this.uxKolicinaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxKolicinaDataGridViewColumn.DataPropertyName = "Kolicina";
			this.uxKolicinaDataGridViewColumn.HeaderText = "Kolicina";
			this.uxKolicinaDataGridViewColumn.Name = "uxKolicinaDataGridViewColumn";
			this.uxKolicinaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxKolicinaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxKolicinaDataGridViewColumn.ReadOnly = false;		
			//
			// uxCijenaDataGridViewColumn
			//
			this.uxCijenaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxCijenaDataGridViewColumn.DataPropertyName = "Cijena";
			this.uxCijenaDataGridViewColumn.HeaderText = "Cijena";
			this.uxCijenaDataGridViewColumn.Name = "uxCijenaDataGridViewColumn";
			this.uxCijenaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxCijenaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxCijenaDataGridViewColumn.ReadOnly = false;		
			//
			// uxValutaDataGridViewColumn
			//
			this.uxValutaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxValutaDataGridViewColumn.DataPropertyName = "Valuta";
			this.uxValutaDataGridViewColumn.HeaderText = "Valuta";
			this.uxValutaDataGridViewColumn.Name = "uxValutaDataGridViewColumn";
			this.uxValutaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxValutaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxValutaDataGridViewColumn.ReadOnly = false;		
			//
			// uxPorijekloDataGridViewColumn
			//
			this.uxPorijekloDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPorijekloDataGridViewColumn.DataPropertyName = "Porijeklo";
			this.uxPorijekloDataGridViewColumn.HeaderText = "Porijeklo";
			this.uxPorijekloDataGridViewColumn.Name = "uxPorijekloDataGridViewColumn";
			this.uxPorijekloDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPorijekloDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPorijekloDataGridViewColumn.ReadOnly = false;		
			//
			// uxDateUIModifiedDataGridViewColumn
			//
			this.uxDateUIModifiedDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDateUIModifiedDataGridViewColumn.DataPropertyName = "DateUIModified";
			this.uxDateUIModifiedDataGridViewColumn.HeaderText = "DateUIModified";
			this.uxDateUIModifiedDataGridViewColumn.Name = "uxDateUIModifiedDataGridViewColumn";
			this.uxDateUIModifiedDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDateUIModifiedDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDateUIModifiedDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDSklDZahtjevGlavaDataGridViewColumn
			//				
			this.uxIDSklDZahtjevGlavaDataGridViewColumn.DisplayMember = "Datum";	
			this.uxIDSklDZahtjevGlavaDataGridViewColumn.ValueMember = "ID";	
			this.uxIDSklDZahtjevGlavaDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDSklDZahtjevGlavaDataGridViewColumn.DataSource = uxIDSklDZahtjevGlavaBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxSklDZahtijevStavkeDataGridView);
			this.Name = "SklDZahtijevStavkeDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDSklDZahtjevGlavaBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxSklDZahtijevStavkeErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxSklDZahtijevStavkeDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxSklDZahtijevStavkeBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				SklDZahtijevStavkeDataGridViewEventArgs args = new SklDZahtijevStavkeDataGridViewEventArgs();
				args.SklDZahtijevStavke = _currentSklDZahtijevStavke;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class SklDZahtijevStavkeDataGridViewEventArgs : System.EventArgs
		{
			private Entities.SklDZahtijevStavke	_SklDZahtijevStavke;
	
			/// <summary>
			/// the  Entities.SklDZahtijevStavke instance.
			/// </summary>
			public Entities.SklDZahtijevStavke SklDZahtijevStavke
			{
				get { return _SklDZahtijevStavke; }
				set { _SklDZahtijevStavke = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxSklDZahtijevStavkeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnSklDZahtijevStavkeDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxSklDZahtijevStavkeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnSklDZahtijevStavkeDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxSklDZahtijevStavkeDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = SklDZahtijevStavkeList[e.RowIndex].ID;
						break;
					case "uxIDSklDZahtjevGlavaDataGridViewColumn":
						e.Value = SklDZahtijevStavkeList[e.RowIndex].IDSklDZahtjevGlava;
						break;
					case "uxSifraArtiklaDataGridViewColumn":
						e.Value = SklDZahtijevStavkeList[e.RowIndex].SifraArtikla;
						break;
					case "uxNazivArtiklaDataGridViewColumn":
						e.Value = SklDZahtijevStavkeList[e.RowIndex].NazivArtikla;
						break;
					case "uxBatchDataGridViewColumn":
						e.Value = SklDZahtijevStavkeList[e.RowIndex].Batch;
						break;
					case "uxNettoMasaDataGridViewColumn":
						e.Value = SklDZahtijevStavkeList[e.RowIndex].NettoMasa;
						break;
					case "uxKolicinaDataGridViewColumn":
						e.Value = SklDZahtijevStavkeList[e.RowIndex].Kolicina;
						break;
					case "uxCijenaDataGridViewColumn":
						e.Value = SklDZahtijevStavkeList[e.RowIndex].Cijena;
						break;
					case "uxValutaDataGridViewColumn":
						e.Value = SklDZahtijevStavkeList[e.RowIndex].Valuta;
						break;
					case "uxPorijekloDataGridViewColumn":
						e.Value = SklDZahtijevStavkeList[e.RowIndex].Porijeklo;
						break;
					case "uxDateUIModifiedDataGridViewColumn":
						e.Value = SklDZahtijevStavkeList[e.RowIndex].DateUIModified;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxSklDZahtijevStavkeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnSklDZahtijevStavkeDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxSklDZahtijevStavkeDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						SklDZahtijevStavkeList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxIDSklDZahtjevGlavaDataGridViewColumn":
						SklDZahtijevStavkeList[e.RowIndex].IDSklDZahtjevGlava = (System.Int32)e.Value;
						break;
					case "uxSifraArtiklaDataGridViewColumn":
						SklDZahtijevStavkeList[e.RowIndex].SifraArtikla = (System.Int32?)e.Value;
						break;
					case "uxNazivArtiklaDataGridViewColumn":
						SklDZahtijevStavkeList[e.RowIndex].NazivArtikla = (System.String)e.Value;
						break;
					case "uxBatchDataGridViewColumn":
						SklDZahtijevStavkeList[e.RowIndex].Batch = (System.String)e.Value;
						break;
					case "uxNettoMasaDataGridViewColumn":
						SklDZahtijevStavkeList[e.RowIndex].NettoMasa = (System.Decimal?)e.Value;
						break;
					case "uxKolicinaDataGridViewColumn":
						SklDZahtijevStavkeList[e.RowIndex].Kolicina = (System.Decimal?)e.Value;
						break;
					case "uxCijenaDataGridViewColumn":
						SklDZahtijevStavkeList[e.RowIndex].Cijena = (System.Decimal?)e.Value;
						break;
					case "uxValutaDataGridViewColumn":
						SklDZahtijevStavkeList[e.RowIndex].Valuta = (System.String)e.Value;
						break;
					case "uxPorijekloDataGridViewColumn":
						SklDZahtijevStavkeList[e.RowIndex].Porijeklo = (System.String)e.Value;
						break;
					case "uxDateUIModifiedDataGridViewColumn":
						SklDZahtijevStavkeList[e.RowIndex].DateUIModified = (System.DateTime)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
